import request, { downloadPost } from '@/utils/request2'
import { materialApiUrl, projectApiUrl } from '../../config'


export default {
  //采购效益率-分页查询
  findListByMain(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/findListByMain', method: 'post', data:{...params, ...data}
    })
  },
  labelTreeList(params, data) {
    return request({
      url: projectApiUrl + '/label/labelTreeList?type=0', method: 'get', params, data
    })
  },
  //打印
  print(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/print/' + params.id, method: 'get', params, data
    })
  },
  //采购效益率-统计
  findListCount(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/findListCount', method: 'post', data:{...params, ...data}
    })
  },
  // 采购效益率-删除基本信息
  deleteByBenefitAnalysis(data, params) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/deleteByBenefitAnalysis', method: 'post', params, data
    })
  },
  // 采购效益率-根据Id查询
  findListByMainId(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/findListByMainId/' + params.id,
      method: 'get', params, data
    })
  },
  // 采购效益率-提交审批
  submitApply(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/submitApply', method: 'post', params, data
    })
  },
  // 采购效益率-根据Id查询子表信息
  findListByDetails(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/findListByDetails', method: 'get', params, data
    })
  },
  // 采购效益率-编辑基本信息
  editByMain(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/editByMain', method: 'post', params, data
    })
  },
  // 采购效益率-新增子表行
  editByDetails(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/editByDetails', method: 'post', params, data
    })
  },

  // 采购效益率-删除子表行
  deleteByDetails(data, params) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/deleteByDetails', method: 'post', params, data
    })
  },
  // 采购效益率-新增基本信息
  createByMain(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/createByMain', method: 'post', params, data
    })
  },
  // 采购效益率-新增子表行
  createByDetails(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/createByDetails', method: 'post', params, data
    })
  },
  // 采购效益率-批量新增
  createByDetailsBatch(data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/createByDetails/batch', method: 'post', data
    })
  },
  // 采购效益率-作废
  cancleApply(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/cancleApply', method: 'post', params, data
    })
  },
  // 采购效益率-附件列表
  findFileList(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/findFileList', method: 'get', params, data
    })
  },
  // 采购效益率-附件列表
  findFileListUrl(params, data) {
    return materialApiUrl + '/materials/material-beneficial/findFileList'
  },
  // 采购效益率-删除附件
  deleteFile(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/deleteFile', method: 'post', params, data
    })
  },
  // 采购效益率-删除附件
  deleteFileUrl(params, data) {
    return materialApiUrl + '/materials/material-beneficial/deleteFile'
  },
  // 采购效益率-新增附件
  addFile(params, data) {
    return request({
      url: materialApiUrl + '/materials/material-beneficial/addFile', method: 'post', params, data
    })
  },
  // 采购效益率-新增附件
  addFileUrl(params, data) {
    return materialApiUrl + '/materials/material-beneficial/addFile'
  },
  downExcel(data) {
    return downloadPost(materialApiUrl + '/materials/material-beneficial/downMaterialAnalysisExcel', data)
  }

}
